﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp.装饰器
{
    /// <summary>
    /// 4.2 添加包装费 - 具体装饰器
    /// </summary>
    public class GiftWrappingDecorator : OrderDecorator
    {
        private readonly double _wrappingCost;

        public GiftWrappingDecorator(IOrder order, double wrappingCost) : base(order)
        {
            _wrappingCost = wrappingCost;
        }

        public override double CalculateTotal()
        {
            return base.CalculateTotal() + _wrappingCost;
        }
    }
}
